<template>
	<view class="content">
		<view class="remark">备注：
			“已发放”指：触发“发放”按钮次数
			“领取数”指：用户实际领取的次数（用户
			打开页面意味着领取）</view>
		<view class="toolKit-btn"><u-button type="primary" text="仅发放工具包" color="#d17060" @click="handleShare"></u-button></view>
		<view class="classify">
			<u-tabs :list="classifyList" @click="handleChange" :activeStyle="{color:'#181818'}"
				:inactiveStyle="{color:'#8b8b8b'}" lineColor="#b95f62"></u-tabs>
		</view>
		<view class="list" v-for="(item,index) in 10" :key="index">
			<view class="top-box">
				<view class="code">激活码</view>
				<view class="title-box">
					<view class="title">电梯检验员刷题</view>
					<view class="date">30天</view>
				</view>
				<view class="num">
					<view><text>本轮总共</text>100个/已发放20个/领取数40人</view>
					<view>可用80个</view>
				</view>
			</view>
			<view class="bot-box">
				<view class="price">
					<view>总发放:80个</view>
					<view>售价:52元</view>
					<view>总领取数:1人</view>
				</view>
				<view class="grant" @click="handleGrant">发放</view>
			</view>
		</view>
		<!-- 发放弹框 -->
		<GrantModel ref="grantModel" />
	</view>
</template>

<script>
	import GrantModel from './GrantModel.vue'
	export default {
		components: {
			GrantModel
		},
		data() {
			return {
				classifyList: [{
					name: '机电WX',
				}, {
					name: '承压WX',
				}, {
					name: '承压WX',
				}]
			}
		},
		onLoad() {

		},
		onShow() {
			uni.hideTabBar()
		},
		methods: {
			handleShare(){
				uni.navigateTo({
					url:'/pages/share/share'
				})
			},
			//发放
			handleGrant(){
				this.$refs.grantModel.setModel()
			},
			handleChange() {}
		}
	}
</script>

<style scoped lang="scss">
	.content {
		padding: 32rpx;
		box-sizing: border-box;
		background: #f0f0f0;
		min-height: 100vh;

		.list {
			margin-top: 24rpx;
			background: #fff;
			border-radius: 18rpx;
			position: relative;

			.bot-box {
				border-top: 1px dashed #eeeeeb;
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 24rpx;
				box-sizing: border-box;

				.price {
					font-size: 28rpx;
					color: #6f6f6f;
					display: flex;
					align-items: center;

					view {
						margin-right: 8rpx;
					}
				}

				.grant {
					width: 120rpx;
					height: 55rpx;
					background: #559768;
					font-size: 26rpx;
					color: #fff;
					display: flex;
					align-items: center;
					justify-content: center;
					border-radius: 16rpx;
					letter-spacing: 4rpx;

				}
			}

			.top-box {
				padding: 24rpx;
				box-sizing: border-box;

				.num {
					display: flex;
					align-items: center;
					justify-content: space-between;
					font-size: 28rpx;
					margin-top: 24rpx;
					color: #484848;

					text {
						color: #6b6b6b;
					}
				}

				.title-box {
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin-top: 32rpx;

					s .title {
						font-size: 32rpx;
						font-weight: 800;
						display: flex;
						flex: 1;
						margin-right: 24rpx;
					}

					.date {
						font-size: 32rpx;
						font-weight: 800;
						color: #d27160;
					}
				}

				.code {
					font-size: 24rpx;
					color: #fff;
					background: #d27160;
					border-radius: 18rpx 0 18rpx 0;
					position: absolute;
					left: 0;
					top: 0;
					padding: 8rpx 20rpx;
				}
			}

		}

		.remark {
			font-size: 26rpx;
			color: #666;
		}

		.toolKit-btn {
			width: 300rpx;
			margin: 24rpx auto;

			/deep/ .u-button {
				border-radius: 18rpx;
			}
		}
	}
</style>